{% extends 'admin/base_admin.html' %}
{% block content %}
<a href="/admin/categories/new" class="inline-block bg-emerald-600 text-white text-sm px-3 py-2 rounded">新建分类</a>
<table class="mt-4 w-full text-sm">
    <thead><tr class="text-left border-b"><th>名称</th><th>slug</th><th>排序</th><th></th></tr></thead>
    <tbody>
        {% for i in items %}
        <tr class="border-b">
            <td>{{ i.name }}</td>
            <td>{{ i.slug }}</td>
            <td>{{ i.sort_order }}</td>
            <td class="text-right space-x-2">
                <a class="text-emerald-700" href="/admin/categories/{{ i.id }}/edit">编辑</a>
                <form class="inline" action="/admin/categories/{{ i.id }}/delete" method="post"><button class="text-rose-600">删除</button></form>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}